	function runApplet()
	{
		var applet = document.MainAlgorithm;
		var resultsBox = document.getElementById('resultsBox').value;

		alert('DEBUG: Found output box element');

		var inputFilePath = document.getElementById('inputFilePath').value;
		applet.setInputFilename(inputFilePath);

		alert('DEBUG: File input set');

		var outputFilePath = document.getElementById('outputFilePath').value;
		applet.setOutputFileName(outputFilePath);

		alert('DEBUG: File output set');

		document.getElementById('resultsBox').value = "Running, please be patient...";
		document.getElementById('statusImage').src = "htmlResources/redButton.jpg";

		alert("Ready to run. Hit OK");
		var errorCode = applet.Run();

		if(errorCode != 0)
		{
			alert("ERROR: "+ applet.getLastError());
			return;
		}
		else
		{
			alert("Algorithm OK");
		}		
		
		document.getElementById('resultsBox').value = "";

			
		//for (i=1;i<=coeffsCount ;i++)
		//{
		//	var currentCoeff = applet.UnloadCoefficient();
		//	document.getElementById('resultsBox').value += currentCoeff + '\n';
		//}
		document.getElementById('statusImage').src = "htmlResources/greenButton.jpg";

	}

	function clearForm()
	{
		document.getElementById('xmlPath').value = "";
		document.getElementById('inputWavPath').value = "";
		document.getElementById('resultsBox').value = "";

	}

	function displayHelp()
	{
		alert("Enter path relative to current folder or in following format:\nfile:/[DRIVE_LETTER]:/[FOLDER]/.../[FILE_NAME].xml");
	}